## Get span assessment by ID

`client.SpanAssessments.Get(ctx, spanAssessmentID) (*SpanAssessment, error)`

**get** `/v5/span-assessments/{span_assessment_id}`

Retrieve a single span assessment by its identifier.

Returns the assessment's type and content fields, the span and trace it is
attached to, and the identity that created it. Returns 404 if no assessment
with that id exists for the caller's account. Use the list endpoint instead
when you have a span or trace id rather than an assessment id.

### Parameters

- `spanAssessmentID string`

### Returns

- `type SpanAssessment struct{…}`

  Response model for span assessment

  - `AssessmentID string`

    Unique identifier for the assessment

  - `AssessmentType AssessmentType`

    Type of assessment

    - `const AssessmentTypeComment AssessmentType = "comment"`

    - `const AssessmentTypeRating AssessmentType = "rating"`

    - `const AssessmentTypeApproval AssessmentType = "approval"`

    - `const AssessmentTypeRubric AssessmentType = "rubric"`

    - `const AssessmentTypeMetadata AssessmentType = "metadata"`

    - `const AssessmentTypeOverwrite AssessmentType = "overwrite"`

  - `CreatedBy string`

    User who submitted the assessment

  - `SpanID string`

    The span this assessment is attached to

  - `TraceID string`

    The trace this assessment is attached to

  - `AccountID string`

    Account this assessment belongs to

  - `Approval ApprovalStatus`

    Approval status (approved/rejected)

    - `const ApprovalStatusApproved ApprovalStatus = "approved"`

    - `const ApprovalStatusRejected ApprovalStatus = "rejected"`

  - `Comment string`

    Raw text feedback

  - `CreatedAt Time`

    When this assessment was created

  - `Metadata map[string, any]`

    Arbitrary JSON object for additional data

  - `Object SpanAssessmentObject`

    - `const SpanAssessmentObjectSpanAssessment SpanAssessmentObject = "span.assessment"`

  - `Overwrite map[string, any]`

    User corrections to span output

  - `Rating int64`

    Numerical rating (1-5)

  - `Rubric map[string, string]`

    Rule key-value pairs for rubric evaluation

  - `UpdatedAt Time`

    When this assessment was last updated

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  spanAssessment, err := client.SpanAssessments.Get(context.TODO(), "span_assessment_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", spanAssessment.AssessmentID)
}
```

#### Response

```json
{
  "assessment_id": "assessment_id",
  "assessment_type": "comment",
  "created_by": "created_by",
  "span_id": "span_id",
  "trace_id": "trace_id",
  "account_id": "account_id",
  "approval": "approved",
  "comment": "comment",
  "created_at": "2019-12-27T18:11:19.117Z",
  "metadata": {
    "foo": "bar"
  },
  "object": "span.assessment",
  "overwrite": {
    "foo": "bar"
  },
  "rating": 1,
  "rubric": {
    "foo": "string"
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```
